<!-- 广告页面片段 -->
<style>
    .advantage .swiper-slide>div{background-repeat:no-repeat;background-position:center;background-size:cover;display:inline-block;width:100%;}
    .advantage .swiper-slide>div:after{content:'';display:block;margin-top:13%;}
</style>
<div class="advantage ani" swiper-animate-effect="bounceInUp" swiper-animate-duration="1.5s" swiper-animate-delay="3s">
    <div class="swiper-wrapper" id="ad1">
    </div>
</div>
<script>
    //图片广告
    $(function() {
        $.get("<{:U('getAd')}>", {type : '1'}, function (res) {
            var str = '';console.log(res);
            $.each(res, function(i, item){
                str += '<div class="swiper-slide" onclick="location.href=\''+item.url+'\'"><div style="background-image: url(<{:C('IMG_PREFIX')}>'+item.pic+');"></div></div>';
            });

            $('#ad1').html(str);

            var mySwiper = new Swiper('.advantage',{
                width : window.innerWidth,
                autoplay :3000,
                autoplayDisableOnInteraction : false,
            });
        }, 'json');
    });
</script>